<?php
namespace Catalog\Data;

use Catalog\Entity\AttributeValuePrice;
use Catalog\Entity\Attribute;
/**
 *
 * @author Paolo Bertuzzo
 *        
 */
class AttributeValuePriceDao extends AbstractDao
{

    /**
     * 
     * @param array $attributeValueIds
     * @param int $storeId
     */
    public function get($attributeValueIds, $storeId)
    {
        $query = $this->entityManager->createQuery('select sum(avp.value) from Catalog\Entity\AttributeValuePrice avp where avp.storeId = ?1 and' .
            ' avp.attributeValueId in (?2)');
        
        $query->setParameter(1, $storeId);
        $query->setParameter(2, $attributeValueIds);
        $query->useResultCache(true);

        return $query->getResult();
    }
    
}

?>